package com.wqiuqiu.gulimall.cart.service;

import com.wqiuqiu.gulimall.cart.vo.Cart;
import com.wqiuqiu.gulimall.cart.vo.CartItemVo;
import com.wqiuqiu.gulimall.cart.vo.CartVo;
import com.wqiuqiu.gulimall.cart.vo.UserInfoTo;

import java.util.List;
import java.util.concurrent.ExecutionException;

public interface CartService {

    CartItemVo addCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    CartItemVo getCart(Long skuId);

    /**
     * 获取整个购物车，如果购物车里的商品信息发生了改变，需要对她进行更新
     * @param userInfoTo
     * @return
     */
    CartVo getCartList(UserInfoTo userInfoTo);

    /**
     * 根据threadLocal找出当前会员id从而找出其购物车信息
     * @return
     */
    List<CartItemVo> getMemberCart();
}
